package com.yitao.client.constant;

import java.util.HashMap;
import java.util.Map;

public enum ConstantDataEnum {

    CC_TOP_MONEY(1L, "CC首重金额(单位分)"),

    CC_CONTINUED_HEAVY_MONEY(2L,"CC续重金额(单位分)"),

    CC_MONETARY_LIMITATION(3L, "CC金额限制(单位分)"),

    CC_MAX_WEIGHT(4L, "CC最大重量限制(kg)"),

    CC_TAX_CUTS(5L, "CC税金减免金额(单位分)"),

    BC_CONTINUED_HEAVY_MONEY(50L, "BC续重金额(单位分)"),

    BC_TOP_MONEY(51L, "BC首重金额(单位分) "),

    BC_MONETARY_LIMITATION(52L, "BC金额限制(单位分)"),

    BC_MAX_WEIGHT(53L, "BC最大重量限制(kg)"),

    BC_VALUE(54L, "BC货值(%)"),

    COEFFICIENT(100L, "物流重量计费系数(%)"),

    TONGTEXPRESS(300L, "通特获取物流单号");

    private static final Map<Long, ConstantDataEnum> map = new HashMap<>();

    static {
        ConstantDataEnum[] values = ConstantDataEnum.values();
        for (ConstantDataEnum item : values) {
            map.put(item.code, item);
        }
    }

    private final Long code;
    private final String name;

    private ConstantDataEnum(Long code, String name) {
        this.code = code;
        this.name = name;
    }

    public static ConstantDataEnum getEnum(Integer code) {
        return map.get(code);
    }

    public Long getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
